export const useLoadingFunc = (
  fun: Function,
  loading: Ref<boolean> = ref(false)
) => {
  const func = async () => {
    // 防止重复触发
    if (loading.value) return;
    loading.value = true;
    try {
      await fun();
    } finally {
      loading.value = false;
    }
  };
  return { loading, func };
};
